package com.rush.manageepac.controller;
import com.rush.manageepac.entity.NATHouse;
import com.rush.manageepac.service.intf.NATHouseService;
import com.rush.manageepac.vo.PageBean;
import com.rush.manageepac.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/nathouse")
public class NATHouseController {
    @Autowired
    private NATHouseService service;

    //新增
    @RequestMapping("save.do")
    public R save(NATHouse natHouse) {
        return service.save(natHouse);
    }

    //删除
    @RequestMapping("del.do")
    public R del(int id) {
        return service.delete(id);
    }

    //查询
    @RequestMapping("page.do")
    public PageBean page(String region, int page, int limit) {
        return service.selectPage(region, page, limit);
    }

    //修改
    @RequestMapping("update.do")
    public R update(NATHouse natHouse){
        return service.update(natHouse);
    }
}
